package com.example.demo;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Copyfright(C),2022-2022,复兴元宇科技有限公司
 * FileName:GetPersonInfoController
 * Author:yz
 * Date:2022/3/10 11:34 上午
 * Description:
 * History:
 * <yz>  <2022/3/10> <1.0> <desc>
 * 作者       时间    版本      描述
 */
@RestController
public class GetPersonInfoController {
    @Value("${age}")
    private int age;

    @Value("${name}")
    private String name;

    @GetMapping("/getage")
    public int getAge() {
        return age;
    }

    @GetMapping("/getname")
    public String getName() {
        return name;
    }
    @Autowired
    private GetPersonInfoProperties getPersonInfoProperties;
    @GetMapping("/getPersonInfoProperties")
    public String getProperties(){
        return getPersonInfoProperties.getName() + " " + getPersonInfoProperties.getAge();
    }
}
